from access.core import CodeSnippet
from access.core import CodeSnippetPattern
from access.core import ProgrammingLanguage
from access.core import Utterance
from access.core import UtteranceGenerator
from access.core import UtterancePattern
import unittest


class ProgrammingLanguageTest(unittest.TestCase):
  def testConstruction (self):
    programming_language = ProgrammingLanguage(vocabulary = dict(v = [1]),
                                               snippets = dict(s = [2]))
    self.assertIn('v',
                  programming_language.vocabulary,
                  'Vocabulary key not added to language.')
    self.assertIn(1,
                  programming_language.vocabulary['v'],
                  'Vocabulary is not set correctly.')
    self.assertIn('s',
                  programming_language.snippets,
                  'Snippet key not added to language.')
    self.assertIn(2,
                  programming_language.snippets['s'],
                  'Snippet is not set correctly.')
    